Final checks / modifications before submitting to CRAN#74
Conversation
…in comparing int with uword
|
@aoliveram, I realized there is a missing figure in one of your vignettes. The Can you share the images that you were planning to add to the vignette? Feel free to attach them here as a comment to the PR and I can do the rest. Thanks! |
|
Here are the missing files, @gvegayon . I remember that when I wrote that vignette, I wanted to build some more professional schemes. What do you think?
|
Let me see what I can do. |
|
I think we can do it in Markdown and it will look almost the same: rdiffnet( graph, seed.p.nodes, seed.nodes, behavior, threshold.dist) Step 0.0: setting n and t if not provided
Step 1.0: setting seed nodes
Step 2.0: setting threshold for each node
Step 3.0: running the simulation
Step 4.0: creating diffnet object
|
|
Here is another one:
Step 5.0: splitting behaviors (optional)
|
|
Last one:
|
|
Looks great. Let's use those instead ;) |
There was a problem hiding this comment.
Pull request overview
This PR prepares netdiffuseR for CRAN submission by simplifying the native build configuration (removing the autoconf configure framework in favor of standard R OpenMP variables), modernizing CI/dev tooling, and updating package-facing documentation/artifacts for the 1.25.0 release.
Changes:
- Removed the custom autoconf-based
configureframework and introduced standardsrc/Makevars/ updatedsrc/Makevars.winOpenMP settings. - Updated release/docs materials (NEWS/README/vignette/man pages) and refreshed a README figure artifact.
- Modernized infrastructure (GitHub Actions versions, devcontainer base image + Quarto install, Makefile tweaks).
Reviewed changes
Copilot reviewed 15 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| vignettes/simulating-multiple-behaviors-on-networks.Rmd | Replaced embedded local images with inline workflow/text/table for multi-behavior diffusion vignette |
| src/plot.cpp | Tightened dimension checks via explicit casts |
| src/Makevars | Added standard OpenMP flags for non-Windows builds |
| src/Makevars.win | Updated Windows build flags/libs to use standard OpenMP variables |
| src/Makevars.in | Removed template Makevars used by the deleted autoconf flow |
| README.md | Bumped referenced version and refreshed sessionInfo output |
| NEWS.md | Updated release date and added “User-visible”/“Internal” headings + notes |
| man/figures/README-plot_diffnet2-withmap-1.png | Updated rendered README figure artifact |
| man/epigames.Rd | Minor whitespace/format cleanup |
| man/diffusion-data.Rd | Table indentation/formatting adjustments |
| man/collapse_timeframes.Rd | Minor whitespace/format cleanup |
| Makefile | Removed --vanilla from Rscript invocations |
| configure.ac | Removed autoconf configuration source |
| configure | Removed generated configure script |
| cleanup | Removed configure cleanup helper |
| .Rbuildignore | Stopped ignoring src/Makevars so it is included in the package build |
| .github/workflows/r.yml | Bumped core GitHub Actions versions (checkout/artifact upload) |
| .github/workflows/pkgdown.yml | Bumped checkout + deploy-pages actions |
| .devcontainer/devcontainer.json | Added an additional VS Code extension to the container |
| .devcontainer/Containerfile | Switched to a smaller base image and added Quarto CLI installation |
| **rdiffnet**( graph, seed.p.nodes, seed.nodes, behavior, threshold.dist) | ||
|
|
||
| **Step 0.0: setting *n* and *t* if not provided** | ||
| * this depends on graph | ||
|
|
||
| **Step 1.0: setting seed nodes** | ||
| * this depends on seed.p.nodes and seed.nodes | ||
|
|
||
| **Step 2.0: setting threshold for each node** | ||
| * ↳ `rdiffnet_make_threshold( threshold.dist, n )` |
There was a problem hiding this comment.
The vignette describes the old rdiffnet() workflow using seed.p.nodes, but the actual argument name in the package API is seed.p.adopt (see R/rdiffnet.r). This mismatch is likely to confuse readers and makes the “Step 1.0” description inconsistent with the rest of the vignette; consider updating the argument list and Step 1.0 text to use seed.p.adopt consistently.
| @@ -0,0 +1,2 @@ | |||
| PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) | |||
There was a problem hiding this comment.
PKG_CXXFLAGS no longer defines -DARMA_64BIT_WORD and -DSTRICT_R_HEADERS (these were present in the previous Makevars(.in/.win)), and there’s no other place in the repo that sets them. If this package relies on 64-bit Armadillo indices and/or strict R headers, dropping these defines can change compilation behavior across platforms; consider restoring them (alongside the OpenMP flags) unless you’ve verified they are unnecessary.
| PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) | |
| PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_64BIT_WORD -DSTRICT_R_HEADERS |
| # For testing | ||
| #PKG_CXXFLAGS=-Wall | ||
|
|
||
| PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) |
There was a problem hiding this comment.
Same as src/Makevars: PKG_CXXFLAGS dropped -DARMA_64BIT_WORD and -DSTRICT_R_HEADERS and the repo doesn’t define them elsewhere. If these defines are still required for RcppArmadillo/R header compatibility on Windows toolchains, this can cause compilation warnings/errors or behavior changes; consider restoring them unless you’ve confirmed they’re safe to remove.
| PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) | |
| PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_64BIT_WORD -DSTRICT_R_HEADERS |
| int n = static_cast<int>(x.n_rows); | ||
| if (n != static_cast<int>(y.n_rows)) | ||
| stop("-x- and -y- lengths do not coincide."); | ||
| if (n != static_cast<int>(toa.n_rows)) | ||
| stop("-x- and -toa- lengths do not coincide."); | ||
| if (n != static_cast<int>(vertex_cex.n_rows)) | ||
| stop("-x- and -vertex_cex- lengths do not coincide."); | ||
| if (graph.n_rows != graph.n_cols) | ||
| stop("-graph- is not a square matrix."); | ||
| if (static_cast<int>(graph.n_rows) != n) | ||
| stop("-graph- does not have the same number of rows as -x-, -y-, and -toa-."); |
There was a problem hiding this comment.
These size checks cast Armadillo dimensions to int. On platforms where arma::uword is 64-bit, this can silently truncate very large objects and make the checks incorrect. Consider keeping the comparisons in arma::uword/std::size_t (and only casting at the R interface boundary if needed).
| # Install quarto-cli and the orange-book extension | ||
| RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.35/quarto-1.9.35-linux-${TARGETARCH}.deb && \ | ||
| dpkg -i quarto-1.9.35-linux-${TARGETARCH}.deb && \ | ||
| rm quarto-1.9.35-linux-${TARGETARCH}.deb |
There was a problem hiding this comment.
The devcontainer downloads and installs the Quarto .deb directly via wget without any integrity verification (checksum/signature). Even though this is “dev-only”, it’s still a supply-chain risk; consider verifying a published SHA256 (or using a package manager / pinned digest) before installing.
|
|
||
| docs: | ||
| Rscript --vanilla -e 'devtools::document()' | ||
| Rscript -e 'devtools::document()' |
There was a problem hiding this comment.
Removing --vanilla from these Rscript invocations means user/site profiles and environment variables can influence devtools::install(), check(), and document(), which reduces reproducibility across machines. If the intent is reliable, “clean” local/CI builds, consider keeping --vanilla at least for check/docs targets.
| Rscript -e 'devtools::document()' | |
| Rscript --vanilla -e 'devtools::document()' |
|
It should be good to go now. Merging |






This pull request introduces several improvements and cleanups to the build system, development environment, and documentation for the
netdiffuseRpackage. The most significant changes include the removal of the customconfigureframework in favor of standard R mechanisms for OpenMP, updates to GitHub Actions workflows and development container setup, and minor documentation and code maintenance.Build system and configuration cleanup:
configureframework and associated scripts, relying instead on R's built-in support for OpenMP and simplifying the build process. This includes deletingconfigure.ac,cleanup, and template Makevars files, and updatingsrc/Makevarsandsrc/Makevars.winto use standard R variables for OpenMP flags. [1] [2] [3] [4] [5].Rbuildignoreto stop ignoringsrc/Makevars, ensuring the correct file is included in the build.Continuous integration and development environment:
actions/checkout@v6,actions/upload-artifact@v7, andactions/deploy-pages@v5, improving CI reliability and security. [1] [2] [3] [4] [5]Documentation and versioning:
1.25.0), includingREADME.mdandNEWS.md, and listed new user-visible and internal changes. [1] [2] [3] [4] [5]--vanillaflag from Rscript calls for consistency. [1] [2] [3]Code maintenance:
src/plot.cppby adding explicit type casts in size checks.These changes collectively modernize the package infrastructure, improve maintainability, and ensure compatibility with current R and CI tooling.